<template>
   <div>
      <h1 ref="countRef">{{count}}</h1>
      <button @click="changeCount">更新</button>
   </div>
</template>

<script>
export default {
    data(){
        return{
            count:0
        }
    },
    methods:{
        async changeCount(){
           for(let i=0;i<10;i++){
             this.count++
             console.log(`第${i+1}次更新的结果:${this.count}`);
             await this.$nextTick()
             console.log('dom',this.$refs.countRef.innerHTML);
           }
        }
    },
    created(){
        console.log('--------created-----------');
        this.$nextTick(()=>{
            console.log( this.$refs.countRef.innerHTML);
        })
      
    }
}
</script>

<style>

</style>